//
//  WeatherTableViewCell.m
//  Today
//
//  Created by fanfan on 15/5/22.
//  Copyright (c) 2015年 fanfan. All rights reserved.
//

#import "WeatherTableViewCell.h"

@implementation WeatherTableViewCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self create];
    }
    return  self;
}
- (void)create{
    self.backview = [[UIImageView alloc] init];
    self.backgroundView.contentMode = UIViewContentModeScaleAspectFit;
    [self.contentView addSubview:self.backview];
    
    self.citylabel = [[UILabel alloc] init];
    [self.contentView addSubview:self.citylabel];
    
    self.temp1label = [[UILabel alloc] init];
    [self.contentView addSubview:self.temp1label];
    
    self.weather1label = [[UILabel alloc] init];
    [self.contentView addSubview:self.weather1label];
    
    self.wind1label = [[UILabel alloc] init];
    [self.contentView addSubview:self.wind1label];
    
    self.fl1label = [[UILabel alloc] init];
    [self.contentView addSubview:self.fl1label];
    
    self.index_dlabel = [[UILabel alloc] init];
    [self.contentView addSubview:self.index_dlabel];
    
    self.label = [[UILabel alloc] init];
    [self.contentView addSubview:self.label];
    
    self.templabel = [[UILabel alloc] init];
    [self.contentView addSubview:self.templabel];
    
    self.temp2label = [[UILabel alloc] init];
    [self.contentView addSubview:self.temp2label];
    
    self.temp3label = [[UILabel alloc] init];
    [self.contentView addSubview:self.temp3label];
    
    self.temp4label = [[UILabel alloc] init];
    [self.contentView addSubview:self.temp4label];
    
    self.weatherlabel = [[UILabel alloc] init];
    [self.contentView addSubview:self.weatherlabel];
    
    self.weather2label = [[UILabel alloc] init];
    [self.contentView addSubview:self.weather2label];
    
    self.weather3label = [[UILabel alloc] init];
    [self.contentView addSubview:self.weather3label];
    
    self.weather4label = [[UILabel alloc] init];
    [self.contentView addSubview:self.weather4label];
    
    self.windlabel = [[UILabel alloc] init];
    [self.contentView addSubview:self.windlabel];
    
    self.wind2label = [[UILabel alloc] init];
    [self.contentView addSubview:self.wind2label];
    
    self.wind3label = [[UILabel alloc] init];
    [self.contentView addSubview:self.wind3label];
    
    self.wind4label = [[UILabel alloc] init];
    [self.contentView addSubview:self.wind4label];

    self.fllabel = [[UILabel alloc] init];
    [self.contentView addSubview:self.fllabel];
    
    self.fl2label = [[UILabel alloc] init];
    [self.contentView addSubview:self.fl2label];
    
    self.fl3label = [[UILabel alloc] init];
    [self.contentView addSubview:self.fl3label];
    
    self.fl4label = [[UILabel alloc] init];
    [self.contentView addSubview:self.fl4label];
}
- (void)layoutSubviews{
    [super layoutSubviews];
    self.backview.frame = CGRectMake(0, 0, self.contentView.frame.size.width, self.contentView.frame.size.height * 2);
    self.backview.image = [UIImage imageNamed:@"天气背景2.jpg"];
    self.backgroundView.contentMode = UIViewContentModeScaleAspectFit;
    
    self.citylabel.frame = CGRectMake(0, 80, 375, 40);
    self.citylabel.textColor = [UIColor whiteColor];
    self.citylabel.textAlignment = NSTextAlignmentCenter;
    self.citylabel.font = [UIFont systemFontOfSize:40];
    
    self.temp1label.frame = CGRectMake(0, 150, 375, 30);
    self.temp1label.textColor = [UIColor whiteColor];
    self.temp1label.textAlignment = NSTextAlignmentCenter;
    self.temp1label.font = [UIFont systemFontOfSize:20];
    
    self.weather1label.frame = CGRectMake(0, 220, 375, 30);
    self.weather1label.textColor = [UIColor whiteColor];
    self.weather1label.textAlignment = NSTextAlignmentCenter;
    self.weather1label.font = [UIFont systemFontOfSize:20];
    
    self.wind1label.frame = CGRectMake(0, 290, 375, 30);
    self.wind1label.textColor = [UIColor whiteColor];
    self.wind1label.textAlignment = NSTextAlignmentCenter;
    self.wind1label.font = [UIFont systemFontOfSize:20];
    
    self.fl1label.frame = CGRectMake(0, 360, 375, 30);
    self.fl1label.textColor = [UIColor whiteColor];
    self.fl1label.textAlignment = NSTextAlignmentCenter;
    self.fl1label.font = [UIFont systemFontOfSize:20];
    
    self.index_dlabel.frame = CGRectMake(50, 430, 270, 100);
    self.index_dlabel.textColor = [UIColor whiteColor];
    self.index_dlabel.numberOfLines = 4;
    self.index_dlabel.textAlignment = NSTextAlignmentCenter;
    self.index_dlabel.font = [UIFont systemFontOfSize:20];
    
    self.label.frame = CGRectMake(100, 15 + 667, 175 + 44, 39);
    self.label.textColor = [UIColor whiteColor];
    self.label.text = @"未来三天天气状况";
    self.label.font = [UIFont systemFontOfSize:22];
    
    self.templabel.frame = CGRectMake(13, 77 + 667, 58, 39);
    self.templabel.text = @"温度";
    self.templabel.font = [UIFont systemFontOfSize:22];
    self.templabel.textColor = [UIColor whiteColor];
    
    self.temp2label.frame = CGRectMake(89, 77 + 667, 89, 39);
   // self.temp2label.text = @"18℃~24℃";
    self.temp2label.font = [UIFont systemFontOfSize:17];
    self.temp2label.textColor = [UIColor whiteColor];
    
    self.temp3label.frame = CGRectMake(186, 77 + 667, 89, 39);
    //self.temp3label.text = @"18℃~24℃";
    self.temp3label.font = [UIFont systemFontOfSize:17];
    self.temp3label.textColor = [UIColor whiteColor];
    
    self.temp4label.frame = CGRectMake(283, 77 + 667, 89, 39);
    //self.temp4label.text = @"18℃~24℃";
    self.temp4label.font = [UIFont systemFontOfSize:17];
    self.temp4label.textColor = [UIColor whiteColor];
    
    self.weatherlabel.frame = CGRectMake(13, 140 + 667, 58, 39);
    self.weatherlabel.text = @"天气";
    self.weatherlabel.font = [UIFont systemFontOfSize:22];
    self.weatherlabel.textColor = [UIColor whiteColor];
    
    self.weather2label.frame = CGRectMake(89, 140 + 667, 100, 50);
    //self.weather2label.text = @"多云";
    self.weather2label.textAlignment = NSTextAlignmentCenter;
    self.weather1label.numberOfLines = 2;
    self.weather2label.font = [UIFont systemFontOfSize:16];
    self.weather2label.textColor = [UIColor whiteColor];
    
    self.weather3label.frame = CGRectMake(186, 140 + 667, 100, 50);
    //self.weather3label.text = @"多云";
    self.weather3label.textAlignment = NSTextAlignmentCenter;
    self.weather3label.numberOfLines = 2;
    self.weather3label.font = [UIFont systemFontOfSize:16];
    self.weather3label.textColor = [UIColor whiteColor];
    
    self.weather4label.frame = CGRectMake(283, 140 + 667, 100, 50);
    //self.weather4label.text = @"多云";
    self.weather4label.textAlignment = NSTextAlignmentCenter;
    self.weather4label.numberOfLines = 2;
    self.weather4label.font = [UIFont systemFontOfSize:16];
    self.weather4label.textColor = [UIColor whiteColor];
    
    
    self.windlabel.frame = CGRectMake(13, 203 + 667, 58, 39);
    self.windlabel.text = @"风况";
    self.windlabel.font = [UIFont systemFontOfSize:22];
    self.windlabel.textColor = [UIColor whiteColor];
    
    self.wind2label.frame = CGRectMake(89, 203 + 667, 100, 50);
    //self.wind2label.text = @"东南风转东风小于3级";
    self.wind2label.textAlignment = NSTextAlignmentCenter;
    self.wind2label.font = [UIFont systemFontOfSize:16];
    self.wind2label.numberOfLines = 2;
    self.wind2label.textColor = [UIColor whiteColor];
    
    self.wind3label.frame = CGRectMake(186, 203 + 667, 100, 50);
    //self.wind3label.text = @"东南风转东风小于3级";
    self.wind3label.textAlignment = NSTextAlignmentCenter;
    self.wind3label.font = [UIFont systemFontOfSize:16];
    self.wind3label.numberOfLines = 2;
    self.wind3label.textColor = [UIColor whiteColor];

    self.wind4label.frame = CGRectMake(283, 203 + 667, 100, 50);
    //self.wind4label.text = @"东南风转东风小于3级";
    self.wind4label.textAlignment = NSTextAlignmentCenter;
    self.wind4label.font = [UIFont systemFontOfSize:16];
    self.wind4label.numberOfLines = 2;
    self.wind4label.textColor = [UIColor whiteColor];
    
    self.fllabel.frame = CGRectMake(13, 263 + 667, 100, 39);
    self.fllabel.text = @"风力";
    self.fllabel.font = [UIFont systemFontOfSize:22];
    self.fllabel.textColor = [UIColor whiteColor];
    
    self.fl2label.frame = CGRectMake(89, 263 + 667, 100, 39);
    //self.fl2label.text = @"小于3级";
    self.fl2label.textAlignment = NSTextAlignmentCenter;
    self.fl2label.font = [UIFont systemFontOfSize:16];
    self.fl2label.numberOfLines = 2;
    self.fl2label.textColor = [UIColor whiteColor];
    
    self.fl3label.frame = CGRectMake(186, 263 + 667, 100, 39);
    //self.fl3label.text = @"小于3级";
    self.fl3label.textAlignment = NSTextAlignmentCenter;
    self.fl3label.font = [UIFont systemFontOfSize:16];
    self.fl3label.numberOfLines = 2;
    self.fl3label.textColor = [UIColor whiteColor];
    
    self.fl4label.frame = CGRectMake(283, 263 + 667, 100, 39);
    //self.fl4label.text = @"小于3级";
    self.fl4label.textAlignment = NSTextAlignmentCenter;
    self.fl4label.font = [UIFont systemFontOfSize:16];
    self.fl4label.numberOfLines = 2;
    self.fl4label.textColor = [UIColor whiteColor];
    
}

- (void)awakeFromNib {
    // Initialization code
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
